import request from '@/utils/request'

// 查询分页合同列表
export function getConMyPageList(query) {
    return request({
        url: '/con/my/page',
        method: 'get',
        params: query
    })
}

export function getConMyTemplatePageList(query) {
    return request({
        url: '/con/my/fileTemplate/page',
        method: 'get',
        params: query
    })
}

// 获取合同编号
export function createConNo() {
    return request({
        url: '/con/my/createConNo',
        method: 'get'
    })
}

// 新增合同
export function addCon(data) {
  return request({
    url: '/con/my/add',
    method: 'post',
    data: data,
    headers: {'content-type': 'multipart/form-data'}
  })
}

// 查询合同基本信息
export function getConMyBasicInfo(id) {
    return request({
        url: '/con/my/getConBasicInfo/' + id,
        method: 'get'
    })
}

// 修改合同基本信息
export function updateConMyBasicInfo(data) {
    return request({
        url: '/con/my/update',
        method: 'put',
        data: data
    })
}

// 删除合同
export function deleteCon(id) {
    return request({
        url: '/con/my/delete/' + id,
        method: 'delete'
    })
}

// 查询合同页面所有权限控制按钮
export function getButtons(id) {
    return request({
        url: '/con/my/getButton/' + id,
        method: 'get'
    })
}

// 查询办理人列表
export function getApplyUserPageList(query) {
    return request({
        url: '/con/my/userSelectPage',
        method: 'get',
        params: query
    })
}

//起草完毕，进入审核中
export function draftComplete(id) {
    return request({
        url: '/con/my/draftComplete/' + id,
        method: 'put'
    })
}

//更换模板
export function changeFileTemplate(query) {
    return request({
        url: '/con/my/changeConTemplate',
        method: 'put',
        params: query
    })
}

// 废弃合同
export function cancelCon(id) {
    return request({
        url: '/con/my/cancel/' + id,
        method: 'put'
    })
}

//审核中--申请审核
export function applyAudit(query) {
    return request({
        url: '/con/my/applyAudit',
        method: 'put',
        params: query
    })
}

//审核完毕，进入签订中
export function auditComplete(id) {
    return request({
        url: '/con/my/auditComplete/' + id,
        method: 'put'
    })
}

//审核中--判断是否需要将Word转换为PDF
export function isNeedWordToPDF(id) {
    return request({
        url: '/con/my/isNeedTransPdf/' + id,
        method: 'get'
    })
}

//签订完毕，进入归档中
export function signComplete(id) {
    return request({
        url: '/con/my/signComplete/' + id,
        method: 'put'
    })
}

//签订中--申请盖章
export function applySign(query) {
    return request({
        url: '/con/my/applySign',
        method: 'put',
        params: query
    })
}

//重新审核合同
export function reAuditCon(id) {
    return request({
        url: '/con/my/reAudit/' + id,
        method: 'put'
    })
}

//履行完毕，进入归档中
export function fulfillComplete(id) {
    return request({
        url: '/con/my/fulfillComplete/' + id,
        method: 'put'
    })
}

//履行中--申请履行
export function applyFulfill(query) {
    return request({
        url: '/con/my/applyFulfill',
        method: 'put',
        params: query
    })
}

//确认归档
export function archiveComplete(id) {
    return request({
        url: '/con/my/archiveComplete/' + id,
        method: 'put'
    })
}

//归档中--申请归档
export function applyArchive(query) {
    return request({
        url: '/con/my/applyArchive',
        method: 'put',
        params: query
    })
}